package com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.resultModel;

import android.os.Parcel;
import android.os.Parcelable;

import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.Event;

/**
 * Created by ZengYan on 2018/5/12.
 *
 * @desc :
 */
public class EventResultModel implements Parcelable {

    private Event event;


    private boolean signUp;



    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public boolean isSignUp() {
        return signUp;
    }

    public void setSignUp(boolean signUp) {
        this.signUp = signUp;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.event, flags);
        dest.writeByte(this.signUp ? (byte) 1 : (byte) 0);
    }

    public EventResultModel() {
    }

    protected EventResultModel(Parcel in) {
        this.event = in.readParcelable(Event.class.getClassLoader());
        this.signUp = in.readByte() != 0;
    }

    public static final Parcelable.Creator<EventResultModel> CREATOR = new Parcelable.Creator<EventResultModel>() {
        @Override
        public EventResultModel createFromParcel(Parcel source) {
            return new EventResultModel(source);
        }

        @Override
        public EventResultModel[] newArray(int size) {
            return new EventResultModel[size];
        }
    };
}
